/*
 * $Id: util.h 7557b5d4d82b 2012/12/02 09:07:16 pgurumur $
 *
 * Copyright (c) 2006, 2007, 2008 Prabhu Gurumurthy <pgurumur@gmail.com>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#ifndef __UTIL_H_
#define __UTIL_H_

#include "dictc.h"

#define DICT_DB_PRESENT                   110
#define DICT_STRATEGIES_AVAILABLE         111
#define DICT_DATABASE_INFO                112
#define DICT_HELP_TEXT                    113
#define DICT_SERVER_INFO                  114
#define DICT_CHALLENGE_FOLLOWS            130
#define DICT_DEFN_RETRIEVED               150
#define DICT_WORD_DB_NAME                 151
#define DICT_MATCHES_FOUND                152

#define DICT_STATS_INFO                   210
#define DICT_TEXT_MESG_ID                 220
#define DICT_CLOSING_CONN                 221
#define DICT_AUTH_SUCCESS                 230
#define DICT_OKAY                         250

#define DICT_SEND_RESPONSE                330

#define DICT_SERV_TEMP_UNAVAIL            420
#define DICT_SERVER_SHUTDOWN              421

#define DICT_SYNTAX_ERROR                 500 
#define DICT_SYNTAX_ILLEGAL_PARAM         501
#define DICT_COMMAND_NOT_IMPLEMENT        502
#define DICT_COMMAND_PARAM_NOT_IMPLEMENT  503
#define DICT_ACCESS_DENIED                530
#define DICT_ACCESS_DENIED_SHOW_INFO      531
#define DICT_ACCESS_DENIED_UNKNOWN        532
#define DICT_INVALID_DB                   550
#define DICT_INVALID_STRATEGY             551
#define DICT_NO_MATCH                     552
#define DICT_NO_DB_PRESENT                554
#define DICT_NO_STRATEGIES_PRESENT        555

#define MAXHISTORY 100
#define DICT_EDITOR  "emacs"
#define DICT_PROMPT  "dict> "
#define SEP " \t"

struct dict_client *dclient;

char line[MAX_CMDLINE];
char *cmd_tokens[MAXTOKEN];

boolean conn_quit;

#endif
